# coding:utf-8
from rest_framework import serializers

from app.autojob.models import InitTaskList, OSInstallTaskList


class CreateUpdateSerializer(serializers.ModelSerializer):
    create_time = serializers.DateTimeField(read_only=True, format="%Y-%m-%d %H:%M:%S")
    update_time = serializers.DateTimeField(read_only=True, format="%Y-%m-%d %H:%M:%S")


class InitTaskListSerializer(CreateUpdateSerializer):
    """资产类型字典"""

    completeTime = serializers.DateTimeField(read_only=True, format="%Y-%m-%d %H:%M:%S")

    class Meta:
        model = InitTaskList
        fields = '__all__'


class OSInstallTaskListSerializer(CreateUpdateSerializer):
    """资产类型字典"""

    completeTime = serializers.DateTimeField(read_only=True, format="%Y-%m-%d %H:%M:%S")

    class Meta:
        model = OSInstallTaskList
        fields = '__all__'
